using System;
using System.Data;
using System.Configuration;
using System.Collections;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;

public partial class MasterPage : System.Web.UI.MasterPage
{

    SessionGebruiker sg;

    protected void Page_Load(object sender, EventArgs e)
    {

        string m = null;
        try
        {
            m = Session["LoggedIn"].ToString();
        }
        catch
        {
        }

        if (m == null || m == "false")
        {
            RootMenu.Items.Clear();
            RootMenu.Items.Add(new MenuItem("Login", "Inloggen"));
            RootMenu.Items.Add(new MenuItem("Menu", "Menu"));
        }
        else
        {
            RootMenu.Items.Clear();
            RootMenu.Items.Add(new MenuItem("Menu", "Menu"));
            RootMenu.Items.Add(new MenuItem("Logout", "Uitloggen"));
        }
    }
    protected void RootMenu_MenuItemClick(object sender, MenuEventArgs e)
    {
        switch (RootMenu.SelectedItem.Value)
        {
            case "Inloggen" :
                Response.Redirect("login.aspx");
                break;
            case "Menu" :
                Response.Redirect("overzicht.aspx");
                  break;
            case "Uitloggen":
                Response.Redirect("login.aspx");
                break;

        }
    }
}
